home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / incoming / jstools-.6v3 / jstools- / jstools-tk3.6v3.0 / lib / jentrybasic.tcl < prev    next >
Encoding:
Text File  |  1995-02-05  |  1.9 KB  |  66 lines

  1. # jentrybasic.tcl - support for basic Entry bindings
  2. # Copyright 1992-1994 by Jay Sekora.  All rights reserved, except 
  3. # that this file may be freely redistributed in whole or in part 
  4. # for non-profit, noncommercial use.
  5.  
  6. ######################################################################
  7. # NOTE:
  8. #   the "jentryemacs.tcl" and "jentryvi.tcl" libraries contain actual
  9. #   procedures for emulation-specific actions.  "basic" bindings,
  10. #   however, don't use anything that isn't general (and therefore
  11. #   in jentrytext.tcl), so this file just has j:eb:basic_init in it.
  12. ######################################################################
  13.  
  14. ######################################################################
  15. # j:eb:basic_init - initialise info for basic Entry bindings
  16. ######################################################################
  17.  
  18. proc j:eb:basic_init { e } {
  19.   global j_teb
  20.   set j_teb(cutbuffer) {}
  21.   set j_teb(dragscroll,txnd) 0
  22.   set j_teb(dragscroll,delay) 50
  23.   set j_teb(scanpaste_time) 0
  24.   set j_teb(scanpaste_paste) 1
  25.     
  26.   set j_teb(keymap,$e) basic
  27.   
  28.   # in tk4, we need to make sure tkTextBind is called _before_
  29.   #   j:tb:key_bind!
  30.   j:tk4 {tkEntryBind Enter}
  31.   
  32.   j:eb:key_bind $e
  33.   j:eb:mouse_bind $e
  34.   
  35.   j:ekb:mkmap Entry basic basic {
  36.     {Control-slash        j:eb:select_all}
  37.     {Control-backslash        j:eb:clear_selection}
  38.     
  39.     {Delete            j:ekb:delete_left}
  40.     {BackSpace            j:ekb:delete_left}
  41.     {Return            j:ekb:self_insert}
  42.     
  43.     {Left            j:ekb:left}
  44.     {Right            j:ekb:right}
  45.     
  46.     {Home            j:ekb:bol}
  47.     {End            j:ekb:eol}
  48.     
  49.     {Control-v            j:eb:paste_selection}
  50.     {Control-i            j:ekb:self_insert}
  51.     {Control-j            j:ekb:self_insert}
  52.     {Control-h            j:ekb:delete_left}
  53.     
  54.     {Control-DEFAULT        j:eb:no_op}
  55.     {DEFAULT            j:ekb:self_insert}
  56.     {Shift-DEFAULT        j:ekb:self_insert}
  57.   }
  58. }
  59.  
  60. # deprecated alias for backward compatibility:
  61.  
  62. proc j:eb:basic_bind { W args } {
  63.   j:eb:basic_init $W
  64. }
  65.